<template>
  <div id='tmpl'>
      <h3 v-text="list.title"></h3>
      <p v-html="list.content"></p>
  </div>
</template>
<script>
export default {
  name: "component_name",
  data () {
    return {
        list: {}
    };
  },
   created(){
      this.id=this.$route.params.id;
      this.getdes();
  },
  methods:{
      getdes(){
          //console.log(this.id)
          var url=this.$common.apidomain+"/api/goods/getdesc/"+this.id   //这个this即Vue没有这个属性会去原型查找
          this.$http.get(url).then(res=>{//es6语法
            console.log(res)
            var data = res.body
            if(data.status!=0){
                Toast(data.message);
                return 
            }
            this.list=data.message[0];
            //console.log(this.list)
          })
      }
  }
}
</script>
<style lang="css" scoped>
    #tmpl{
        padding: 5px;
    }
    h3{
        color: #0094ff;
    }
</style>